#include <stdio.h>
#include <string.h>

int main() {
    char str1[64] = "asdasdasddasdcasdf", str2[64] = "asdf";

    gets(str1);
    gets(str2);

    unsigned int size1 = strlen(str1), size2 = strlen(str2);
    int next[size2];
    next[0] = 0;
    for (int i = 1; i < size2; ++i) {
        int j = i - 1;
        while (1) {
            if (next[j] == 0 || str2[i - 1] == str2[next[j] - 1]) {
                next[i] = next[j] + 1;
                break;
            }
            j = next[j] - 1;
        }
    }

    _Bool flag;
    for (int i = 0; i <= size1 - size2; ++i) {
        flag = 1;
        for (int j = 0; j < size2; ++j) {
            if (str1[i + j] != str2[j]) {
                flag = 0;
                if (j != 0) {
                    i = i + next[j];
                }
                break;
            }
        }
        if (flag) break;
    }

    puts(flag ? "存在" : "不存在");

}